import type { ResponseStruct } from '#/global'
/**
* 获取RdOrganizeUserApply分页列表
* @returns
*/
export function page(data: any): Promise<ResponseStruct<any>> {
    return useHttp().get('organization/rdOrganizeUserApply/list', { params: data })
}

/**
* 添加RdOrganizeUserApply
* @returns
*/
export function create(data: any): Promise<ResponseStruct<any>> {
  return useHttp().post('organization/rdOrganizeUserApply', data)
}
/**
* 更新RdOrganizeUserApply数据
* @returns
*/
export function save(id: number, data: any): Promise<ResponseStruct<any>> {
    return useHttp().put(`organization/rdOrganizeUserApply/${id}`, data)
}

/**
* 将RdOrganizeUserApply删除，有软删除则移动到回收站
* @returns
*/
export function deleteByIds(ids: number[]): Promise<ResponseStruct<null>> {
  return useHttp().delete('organization/rdOrganizeUserApply', { data: ids })
}

/**
* 审批用户权限申请
* @param id 审批ID
* @param data 审批数据 
*   - status: 2=通过, 3=拒绝
*   - ids: 站点对象数组 [{ s: 站点id, r: 角色id }]，r: 1=管理员, 2=安全员
*   - remark: 审批意见
* @returns
*/
export function approveApply(id: number, data: { status: number; ids?: Array<{ s: number; r: number }>; remark?: string }): Promise<ResponseStruct<any>> {
  return useHttp().put(`organization/rdOrganizeUserApply/apply/${id}`, data)
}